@extends('admin.main')
@section('content')
    <div class="admin-content">
        <div class="am-cf am-padding am-padding-bottom-0">
            <div class="am-fl am-cf">
                <strong class="am-text-primary am-text-lg">后台设置</strong> /
                <small>企业资料</small> /
                <small>工厂设备</small>
            </div>
        </div>
        <hr>
        <div class="am-g">
            @include('admin.layouts.adminInfo')
            <div class="am-u-sm-12 am-u-md-8 am-u-md-pull-4">
                <form action="{{$prefix_url}}/option/yield-set"
                      class="am-form" method="POST" enctype="multipart/form-data">
                    {{csrf_field()}}
                    <input type='hidden' name='_method' value='POST'/>
                    <input type='hidden' name='uid' value='{{$uid}}'/>
                    <input type='hidden' name='cate' value='{{$cate}}'/>
                    <div class='am-form-group'>
                        <h2>产量产能</h2>
                    </div>
                    <style type="text/css">
                        td { border:1px solid #f0f0f0;text-align:center; }
                        td input[type='text'] { padding:5px 0;width:25%;
                            border:0;border-bottom:1px solid #0088cc; }
                        td input[type='file'] { padding:5px 0;width:100%;
                            border:1px solid #0088cc; }
                        td input[type='radio'] { width:15px;height:15px;
                            border:1px solid #0088cc; }
                    </style>
                    <div class='am-form-group' style="background:#f0f0f0;">
                        <label>部门人数：</label>
                        <br>
                        <table class="am-table am-table-striped
                            am-table-hover table-main">
                            <tr>
                                <td width="50%">部门</td>
                                <td>人数</td>
                            </tr>
                        @if(count($departs))
                        @foreach($departs as $key => $depart)
                            <tr>
                                <td>
                                    <input type="checkbox" name="departKeys[]"
                                           value="{{$key}}" style="display:none;">
                                    <input type="text" name="departKey{{$key}}"
                                           minlength="2" maxlength="20" required
                                           value="{{$depart['key']}}">
                                </td>
                                <td>
                                    <input type="text" name="departNum{{$key}}"
                                           pattern="\d+" required
                                           value="{{$depart['num']}}">
                                </td>
                            </tr>
                        @endforeach
                        @endif
                            <tr>
                                <td colspan="10" style="text-align:center;">
                                    以下是新增的部门人数
                                </td>
                            </tr>
                            <tr>
                                <td>
                                    <input type="text" name="departKey"
                                           minlength="2" maxlength="20"
                                           placeholder="部门">
                                </td>
                                <td>
                                    <input type="text" name="departNum"
                                           pattern="\d+"
                                           placeholder="人数">
                                </td>
                            </tr>
                            <tr>
                                <td colspan="10"><hr></td>
                            </tr>
                        </table>
                    </div>
                    <br><hr><br>
                    <div class='am-form-group' style="background:#f0f0f0;">
                        <label>日产量：</label>
                        <input type="text" name="dayStart" placeholder="产量始"
                               value="{{$dayOutPuts?$dayOutPuts[0]:0}}">
                        至
                        <input type="text" name="dayEnd" placeholder="产量末"
                               value="{{$dayOutPuts?$dayOutPuts[1]:0}}">
                        <br><br>
                    </div>
                    <br><hr><br>
                    <div class='am-form-group' style="background:#f0f0f0;">
                        <label>质量要求：</label>
                        <br>
                        <table class="am-table am-table-striped
                            am-table-hover table-main">
                            <tr>
                                <td width="40%">产品类型</td>
                                <td>几道检验</td>
                            </tr>
                        @if(count($pros))
                            @foreach($pros as $key => $pro)
                            <tr>
                                <td>
                                    <input type="checkbox" name="proKeys[]"
                                           value="{{$key}}" style="display:none;">
                                    <input type="text" name="proKey{{$key}}"
                                           minlength="2" maxlength="20" required
                                           value="{{$pro['key']}}">
                                </td>
                                <td>
                                    <label>
                                        <input type="radio" name="proVal{{$key}}"
                                               value="1">
                                        一道检验
                                    </label>
                                    &nbsp; &nbsp; &nbsp; &nbsp;
                                    <label>
                                        <input type="radio" name="proVal{{$key}}"
                                               value="2">
                                        二道检验
                                    </label>
                                </td>
                            </tr>
                            @endforeach
                        @endif
                            <tr>
                                <td colspan="10" style="text-align:center;">
                                    以下是新增的质量要求
                                </td>
                            </tr>
                            <tr>
                                <td>
                                    <input type="text" name="proKey"
                                           minlength="2" maxlength="20"
                                           placeholder="产品类型">
                                </td>
                                <td>
                                    <label>
                                        <input type="radio" name="proVal"
                                               value="1">
                                        一道检验
                                    </label>
                                    &nbsp; &nbsp; &nbsp; &nbsp;
                                    <label>
                                        <input type="radio" name="proVal"
                                               value="2">
                                        二道检验
                                    </label>
                                </td>
                            </tr>
                            <tr>
                                <td colspan="10"><hr></td>
                            </tr>
                        </table>
                    </div>
                    <br><hr><br>
                    <div class='am-form-group' style="background:#f0f0f0;">
                        <label>质量部门：</label>
                        <br>
                        <table class="am-table am-table-striped
                            am-table-hover table-main">
                            <tr>
                                <td width="50%">部门</td>
                                <td>人数</td>
                            </tr>
                        @if(count($depart2s))
                            @foreach($depart2s as $key => $depart2)
                            <tr>
                                <td>
                                    <input type="checkbox" name="depart2Keys[]"
                                           value="{{$key}}"
                                           style="display:none;">
                                    <input type="text" name="depart2Key{{$key}}"
                                           minlength="2" maxlength="20" required
                                           value="{{$depart2['key']}}">
                                </td>
                                <td>
                                    <input type="text" name="depart2Num{{$key}}"
                                           pattern="\d+" required
                                           value="{{$depart2['num']}}">
                                </td>
                            </tr>
                            @endforeach
                        @endif
                            <tr>
                                <td colspan="10" style="text-align:center;">
                                    以下是新增的质量部门人数
                                </td>
                            </tr>
                            <tr>
                                <td>
                                    <input type="text" name="depart2Key"
                                           minlength="2" maxlength="20"
                                           placeholder="部门">
                                </td>
                                <td>
                                    <input type="text" name="depart2Num"
                                           pattern="\d+"
                                           placeholder="人数">
                                </td>
                            </tr>
                            <tr>
                                <td colspan="10"><hr></td>
                            </tr>
                        </table>
                    </div>
                    <br><hr><br>
                    <div class='am-form-group' style="background:#f0f0f0;">
                        <label>质量标准：</label>
                        <br> &nbsp;  &nbsp;
                        <label>
                            <input type="checkbox" name="standard1[]"
                                   value="{{$standards[0]?1:0}}">
                            《工艺单》、样品
                        </label>
                        <br> &nbsp;  &nbsp;
                        <label>
                            <input type="checkbox" name="standard2[]"
                                   value="{{$standards[1]?1:0}}">
                            摊平用尺量用目视用手摸
                        </label>
                        <br> &nbsp;  &nbsp;
                        <label>
                            <input type="checkbox" name="standard3[]"
                                   value="{{$standards[2]?1:0}}">
                            质检：每件产品全检
                        </label>
                        <br> &nbsp;  &nbsp;
                        <label>
                            <input type="checkbox" name="standard4[]"
                                   value="{{$standards[3]?1:0}}">
                            总检：抽查品质、尺寸
                        </label>
                        <br> &nbsp;  &nbsp;
                        <label>
                            <input type="checkbox" name="standard5[]"
                                   value="{{$standards[4]?1:0}}">
                            巡检：对在线生产产品巡查
                        </label>
                    </div>
                    <br><hr><br>
                    <button type='button' class='am-btn am-btn-primary'
                            onclick='history.go(-1);'>返回</button>
                    <button type='submit' class='am-btn am-btn-primary'>
                        保存更新</button>
                </form>
                <br><br>
            </div>
        </div>
    </div>

    <script type="text/javascript">
//        //日期组件
//        $(function() {
//            $('.doc-datepicker').datepicker().
//            on('changeDate.datepicker.amui', function(event) {
//                console.log(event.date);
//            });
//        });
    </script>
@stop